#ifndef LOCKIMP_H_HEADER_INCLUDED_B88FB5B8
#define LOCKIMP_H_HEADER_INCLUDED_B88FB5B8

#include "os.h"

class LockImp 
{
public:
	LockImp();
	LockImp(int i);
	~LockImp();

	int waitTimeOut(unsigned int nTime);
	void signal();

protected:
	LockImp(const LockImp& l);

protected:
	psem_t		m_pSem;
};

class AutoLockImp
{
public:
	AutoLockImp(LockImp& l);
	~AutoLockImp();

protected:
	AutoLockImp& operator=(const AutoLockImp& l);
	LockImp&   m_cLock;
};

class BaseLock
{
public:
	BaseLock();
	BaseLock(int i);
	~BaseLock();

protected:
	BaseLock& operator=(const BaseLock& l);

public:
	int wait(unsigned int nTime = SEM_WAIT_INFINITE);
	void signal();

protected:
	LockImp   m_cLock;
};

#endif /* LOCKIMP_H_HEADER_INCLUDED_B88FB5B8 */
